class MyArray<T>{
    public T[] array = (T[])new Object[10];

    public void setVal(int pos,T val){
        array[pos]=val;
    }
    public T getPos(int pos){
        return array[pos];
    }
}

public class TestDemo {
    public static void main(String[] args) {
        MyArray<Integer> myArray = new MyArray<Integer>();
        myArray.setVal(0,10);

        MyArray<String> myArray1 = new MyArray<String>();
        myArray1.setVal(0,"hello");

        System.out.println(myArray);
        System.out.println(myArray1);
    }
}
